﻿@model blacksoft.Models.ProgramacionViaje
@using blacksoft.Helpers
@{
    ViewBag.Title = "Viajes";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<div class="block big">
    <div class="titlebar">
        <h3>Modificar Viaje</h3>
    </div>
    <div class="block_cont">
        @using (Html.BeginForm())
        {
            @Html.AntiForgeryToken()

            <div class="form">
                @Html.ValidationSummary(true)
                @Html.HiddenFor(model => model.IDProgramacionViaje)

                <div class="form-group">
                    <table>
                        <tr>
                            <td>
                                @Html.LabelForRequired(model => model.FechaSalida)
                                @Html.TextBoxFor(model => model.FechaSalida, new { @class = "text-box single-line", @disabled = "disabled" })
                                @Html.ValidationMessageFor(model => model.FechaSalida)
                                @Html.HiddenFor(model => model.FechaSalida)
                                @Html.ValidationMessage("ErrorFechaSalida")
                            </td>
                            <td>
                                @Html.LabelForRequired(model => model.FechaLlegada)
                                @Html.TextBoxFor(model => model.FechaLlegada, new { @class = "text-box single-line", @disabled = "disabled" })
                                @Html.ValidationMessageFor(model => model.FechaLlegada)
                                @Html.HiddenFor(model => model.FechaLlegada)
                            </td>
                        </tr>
                    </table>
                </div>

                @if (Model.Estado == "PR") { 
                <div class="form-group">
                    @Html.LabelForRequired(model => model.Descripcion)
                    @Html.EditorFor(model => model.Descripcion)
                    @Html.ValidationMessageFor(model => model.Descripcion)
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.CapacidadPasajeros)
                    @Html.TextBoxFor(model => model.CapacidadPasajeros, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })
                    @Html.ValidationMessageFor(model => model.CapacidadPasajeros)

                </div>

                <div class="form-group">
                    @Html.LabelForRequired(model => model.TipoServicio)
                    @Html.DropDownList("TipoServicio", new[]
                {
                    new SelectListItem() {Text = "Económico", Value="1"},
                    new SelectListItem() {Text = "VIP", Value="2"},
                })
                    @Html.ValidationMessageFor(model => model.TipoServicio)
                </div>

                <div class="form-group">
                    @Html.LabelForRequired(model => model.Precio)
                    @Html.EditorFor(model => model.Precio)
                    @Html.ValidationMessageFor(model => model.Precio)
                </div>
                }
                else
                {
                    <div class="form-group">
                    @Html.LabelForRequired(model => model.Descripcion)
                    @Html.TextBoxFor(model => model.Descripcion, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })
                    @Html.HiddenFor(model => model.Descripcion)
                        @Html.ValidationMessageFor(model => model.Descripcion)
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.CapacidadPasajeros)
                    @Html.TextBoxFor(model => model.CapacidadPasajeros, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })
                    @Html.ValidationMessageFor(model => model.CapacidadPasajeros)

                </div>

                <div class="form-group">
                    @Html.LabelForRequired(model => model.TipoServicio)
                    @Html.TextBoxFor(model => model.TipoServicio, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })
                    @Html.HiddenFor(model => model.TipoServicio)
                    @Html.ValidationMessageFor(model => model.TipoServicio)
                </div>

                <div class="form-group">
                    @Html.LabelForRequired(model => model.Precio)
                    @Html.TextBoxFor(model => model.Precio, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })
                    @Html.HiddenFor(model => model.Precio)
                    @Html.ValidationMessageFor(model => model.Precio)
                </div>
                }

                <div class="form-group">
                    @Html.LabelForRequired(model => model.Estado)
                    @if (Model.Estado == "PR")
                    {
                        @Html.DropDownList("Estado", new[]
                        {
                            new SelectListItem() {Text = "Programado", Value="PR"},
                            new SelectListItem() {Text = "Viajando", Value="VI"},
                        })
                        @Html.ValidationMessageFor(model => model.Estado)
                    }
                    else
                        if (Model.Estado == "VI")
                        {
                            @Html.DropDownList("Estado", new[]
                            {
                                new SelectListItem() {Text = "Viajando", Value="VI"},
                                new SelectListItem() {Text = "Completado", Value="CO"},
                            })
                            @Html.ValidationMessageFor(model => model.Estado)
                        }
                        else
                            if (Model.Estado == "CO")
                            {
                                @Html.DropDownList("Estado", new[]
                                {
                                new SelectListItem() {Text = "Completado", Value="CO"},
                                }, string.Empty, new { @disabled = "disabled" })
                            }
                </div>

                <br />

                <div style="padding-top:20px">
                    <div class="titlebar">
                        <h3>Productos Necesarios</h3>
                    </div>

                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("Nombre", "Nombre", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Descripción", "Descripción", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Cantidad", "Cantidad", new { @style = "width:100px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Unidad", "Unidad de Medida", new { @style = "width:130px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Productos)

                </div>

                @if (Model.Estado == "PR") { 
                <div style="padding-top:20px">
                    <div class="titlebar">
                        <a style="display:inline-block"><h3>Seleccionar Choferes</h3>@Html.ValidationMessage("ErrorMinChoferes")</a>
                    </div>


                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("SELECCIONAR", "SELECCIONAR", new { @style = "width:100px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("ApellidoPaterno", "Apellido Paterno", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("ApellidoMaterno", "Apellido Materno", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Nombre", "Nombre", new { @style = "width:130px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("DNI", "DNI", new { @style = "width:130px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("CargoPersonal", "Cargo", new { @style = "width:130px;background:#363D47; color: white;border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Telefono", "Telefono", new { @style = "width:70px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            @*<td>
                                    @Html.TextBox("Celular", "Celular", new { @style = "width:100px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                                </td>*@
                            <td>
                                @Html.TextBox("Estado", "Estado", new { @style = "width:130px; background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Choferes)
                </div>
                <div style="padding-top:50px">
                    <div class="titlebar">
                        <a style="display:inline-block"><h3>Seleccionar Terramozas</h3>@Html.ValidationMessage("ErrorMinTerramozos")</a>
                    </div>


                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("SELECCIONAR", "SELECCIONAR", new { @style = "width:100px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("ApellidoPaterno", "Apellido Paterno", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("ApellidoMaterno", "Apellido Materno", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Nombre", "Nombre", new { @style = "width:130px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("DNI", "DNI", new { @style = "width:130px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("CargoPersonal", "Cargo", new { @style = "width:130px;background:#363D47; color: white;border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Telefono", "Telefono", new { @style = "width:70px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            @*<td>
                                    @Html.TextBox("Celular", "Celular", new { @style = "width:100px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                                </td>*@
                            <td>
                                @Html.TextBox("Estado", "Estado", new { @style = "width:130px; background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Terramozas)

                </div>
                <div style="padding-top:50px">
                    <div class="titlebar">
                        <a style="display:inline-block"> <h3>Seleccionar Unidad de Transporte</h3>@Html.ValidationMessage("ErrorMinBuses")</a>
                    </div>



                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("SELECCIONAR", "SELECCIONAR", new { @style = "width:100px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Placa", "Placa", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Año", "Año", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Tipo", "Tipo", new { @style = "width:150px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Ruta", "Ruta", new { @style = "width:250px;background:#363D47; color: white;border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Estado", "Estado", new { @style = "width:70px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Buses)

                </div>
                <div style="padding-top:50px">
                    <div class="titlebar">
                        <h3>Seleccionar Promociones a Aplicar</h3>
                    </div>

                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("SELECCIONAR", "SELECCIONAR", new { @style = "width:100px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Descripcion", "Descripcion", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Porcentaje", "Porcentaje de Descuento", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Puntos", "Puntos Requeridos", new { @style = "width:130px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Inicio", "Fecha de Inicio", new { @style = "width:130px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Fin", "Fecha de Fin", new { @style = "width:130px;background:#363D47; color: white;border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Estado", "Estado", new { @style = "width:70px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Cliente", "Tipo de Cliente", new { @style = "width:130px; background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Promociones)
                </div>
                }
                <br />
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <input type="submit" value="Guardar" class="btn btn-default" />
                        <br />
                        @Html.ActionLink("Regresar al listado", "Index")
                    </div>
                </div>
            </div>
        }
    </div>
</div>




